package pt.iscte.pcd.example.threads;

public class LancadorDeThreads {

	private static final int N_THREADS = 2;
	private Thread[] threads;
	
	public LancadorDeThreads(int nThreads) {
		threads = new Thread[nThreads];
		for(int i = 0; i != nThreads; i++) {
			threads[i] = new MyThread(i);
		}
	}

	private void execute() {
		for(int i = 0; i != threads.length; i++) {
			threads[i].start();
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new LancadorDeThreads(N_THREADS).execute();

	}


}
